<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>积分平台</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" type="text/css" href="__INDEX__/mui/css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/checkWork.css"/>
		<script src="__INDEX__/js/lib/font.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body >
	    <header class="mui-bar mui-bar-nav">
	        <a class="mui-icon mui-icon-left-nav mui-pull-left goindex"style="color: #ffffff"></a>
	        <h1 class="mui-title">考勤</h1>
	        <a href="{:url('index/attenStatic')}" class="mui-pull-right tongji">
	        	考勤统计
	        </a>
	    </header>
	    <div class="mui-content">
	    	<div class="date">
	    		<div class="dateCont">
	    			<span class="dateJianTou mui-pull-left mui-icon mui-icon-back zuo" dataY="{$nian}" dataM="{$yue}"></span>
	    			<span class="dateTime">{$nian}年{$yue}月</span>
	    			<span class="dateJianTou mui-pull-right mui-icon mui-icon-forward you" dataY="{$nian}" dataM="{$yue}"></span>
	    		</div>
	    	</div>
	    	<div class="modular" >
	    		<div class="top-title">
					<span class="riqi">日期</span>
					<span class="shangban">上班</span>
					<span class="xiaban">下班</span>
				</div>
				<div id="wrapper" class="scrollCont">
		    		<div class="cont" id="scroller">
		    			<ul>
		    				{foreach $clock as $key=>$value}
		    				<li>
		    					<div class="dateContent">
		    						<span class="dateTimeCont">{$key}</span>
									{if $value['toWork']}
									{if is_array($value['toWork'])}
										{if $value['toWork']['leave']==1}
											<span class="contQingjia">请假</span>
										{elseif $value['toWork']['absenteeism']==1}
											<span class="contQingjia">旷工</span>
										{elseif $value['toWork']['late']==1}
											<span class="contQingjia">迟到</span>
										{elseif $value['toWork']['leave']==0&&$value['toWork']['absenteeism']==0&&$value['toWork']['late']==0}
											<span class="contChenGong mui-icon mui-icon-checkmarkempty"></span>
										{/if}
									{/if}
									{else}
									<span class="contCuoWu mui-icon mui-icon mui-icon-closeempty"></span>
									{/if}
									{if $value['offWork']}
									{if is_array($value['offWork'])}
									{if $value['offWork']['leave']==1}
									<span class="contQingjia">请假</span>
									{elseif $value['offWork']['early_retreat']==1}
									<span class="contQingjia">早退</span>
									{elseif $value['offWork']['leave']==0&&$value['offWork']['absenteeism']==0&&$value['offWork']['early_retreat']==0}
									<span class="contChenGong mui-icon mui-icon-checkmarkempty"></span>
									{/if}
									{/if}
									{else}
									<span class="contCuoWu mui-icon mui-icon mui-icon-closeempty"></span>
									{/if}
									<!--<span class="contChidao">请假</span>-->
									<!--<span class="contChenGong mui-icon mui-icon-checkmarkempty"></span>-->
		    					</div>
		    				</li>
							{/foreach}
		    			</ul>
		    		</div>
	    		</div>
	    		<!--<div class="date-footer">-->
	    			<!--<p class="punchOk">正常打卡<i></i><span>1天</span></p>-->
	    			<!--<p class="punchOut">请假<i></i><span>1天</span></p>-->
	    			<!--<p class="punchNo">迟到/早退<i></i><span>16次</span></p>-->
	    		<!--</div>-->
	    	</div>
	    </div>
		<script src="__INDEX__/js/lib/zepto.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/mui/js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/mui/js/mui.view.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/layer_mobile/layer.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/common.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/lib/iscroll.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/checkWork.js" type="text/javascript" charset="utf-8"></script>
		<script src="__INDEX__/js/maowenke.js" type="text/javascript" charset="utf-8"></script>
	<script>
        $(".goindex").on('tap',function () {
            window.location.href = "{:url('index/index')}";
        });
		$(".zuo").on('tap',function () {
			var $year = parseInt($(this).attr('dataY'));
			var $yue  = parseInt($(this).attr('dataM'));
			if($yue==1){
			    $year = $year-1;
			    $yue  = 12;
			}else{
			    $yue = $yue-1;
			}
			if($yue<10){
			    $yue='0'+$yue;
			}
			window.location.href = "{:url('index/checkWork')}?year="+$year+"&month="+$yue+'&type={$type}';
        });
        $(".you").on('tap',function () {
            var $year = parseInt($(this).attr('dataY'));
            var $yue  = parseInt($(this).attr('dataM'));
            if($yue==12){
                $year = $year+1;
                $yue  = 1;
			}else{
                $yue = $yue+1;
			}
            console.log($year);
            console.log($yue);
            var $month = $yue;
            if($month<10){
                $month = '0'+$month;
            }
            var $time = new Date();
            var $ye   = $time.getFullYear();
            var $yu   = $time.getMonth()+1;
            if($yu<10){
                $yu = '0'+$yu;
            }
            console.log($year+''+$month);
            if(parseInt($year+''+$month)>parseInt($ye+''+$yu)){
                mui.alert($month+'月还没到');
            }else{
                if($yue<10){
                    $yue='0'+$yue;
                }
                window.location.href = "{:url('index/checkWork')}?year="+$year+"&month="+$yue+'&type={$type}';
			}
        });
	</script>
	</body>
</html>
